]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Handle overlay key
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 28 Jun 2020 00:45:18 +0000 (02:45 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 2 Mar 2021 14:36:26 +0000 (15:36 +0100)
It's where all the fun state is handled now, so move the super-key
handling there as well, in preparation of making it a bit more
sophisticated.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1736>

js/ui/main.js
js/ui/overviewControls.js

index 94c43dcce026fd3031069b2ad47fa9d80074de56..bf7b6acc1aa3f5778ff4b2e48bb975974829f904 100644 (file)
@@ -50,8 +50,6 @@ const ParentalControlsManager = imports.misc.parentalControlsManager;
 const Config = imports.misc.config;
 const Util = imports.misc.util;
 
-const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
-const STICKY_KEYS_ENABLE = 'stickykeys-enable';
 const WELCOME_DIALOG_LAST_SHOWN_VERSION = 'welcome-dialog-last-shown-version';
 // Make sure to mention the point release, otherwise it will show every time
 // until this version is current
@@ -96,7 +94,6 @@ var locatePointer = null;
 let _startDate;
 let _defaultCssStylesheet = null;
 let _cssStylesheet = null;
-let _a11ySettings = null;
 let _themeResource = null;
 let _oskResource = null;
 
@@ -238,13 +235,6 @@ function _initializeUI() {
 
     new PointerA11yTimeout.PointerA11yTimeout();
 
-    _a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
-
-    global.display.connect('overlay-key', () => {
-        if (!_a11ySettings.get_boolean(STICKY_KEYS_ENABLE))
-            overview.toggle();
-    });
-
     global.connect('locate-pointer', () => {
         locatePointer.show();
     });
index 1e276635b46a23605b4782d021e9d7655bc991f2..3116df4870723f4ded950e4ef4664b765890d3d7 100644 (file)
@@ -16,6 +16,8 @@ const WorkspacesView = imports.ui.workspacesView;
 const SMALL_WORKSPACE_RATIO = 0.15;
 const DASH_MAX_HEIGHT_RATIO = 0.15;
 
+const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
+
 var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
 
 var ControlsState = {
@@ -363,6 +365,15 @@ class ControlsManager extends St.Widget {
                 },
             });
 
+        this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
+
+        global.display.connect('overlay-key', () => {
+            if (this._a11ySettings.get_boolean('stickykeys-enable'))
+                return;
+
+            Main.overview.toggle();
+        });
+
         Main.wm.addKeybinding(
             'toggle-application-view',
             new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),